package test;

import java.rmi.Remote;
import java.rmi.RemoteException;
import java.util.HashMap;

import com.visec.hdy.transmission.rmi.RMIFactory;
import com.visec.hdy.transmission.rmi.code.RMIClient;
import com.visec.hdy.transmission.rmi.code.RMIServer;
import com.visec.hdy.transmission.rmi.config.RMIModelCV;

public class RmiClient {
	public static void main(String[] args) throws RemoteException {
		RMIModelCV rmiModelCV = new RMIModelCV();
		HashMap<String,String> hashMap = new HashMap<String, String>();
		hashMap.put("-rmiUrl", "rmi:/localhost:4400/one");
		hashMap.put("-exportPort", "4402");
		rmiModelCV.setParams(hashMap);
		RMIClient createClient = RMIFactory.getInstance().createClient(rmiModelCV.getParameter());
		System.out.println(createClient.lookup());
		OneI lookup =  (OneI) createClient.lookup();
		System.out.println(lookup.getName());
		
		createClient.unbind();
		
		createClient.bind("rmi:/localhost:4400/sb", new One());
		
		
		
	}
}
